<template>
  <div class="hello">
    <div>{{$store.state.count}}</div>
    <div> {{$store.getters.doneTodos}}</div>
    <h1>{{firstWorkDone}}</h1>
    <button @click="buttonClick">按钮</button>
  </div>
</template>

<script>
import Vue from 'vue'
export default {
  name: 'HelloWorld',
  data () {
    return {
      num: 6
    }
  },
  methods: {
    buttonClick() {
      this.$store.commit('incrementSetp', 10);
      this.num ++;
      this.$store.commit('addObject', { name: this.num + "work", done: true })
    }
  },
  computed: {
    firstWorkDone: {
      get() {
        return this.$store.getters.doneTodosWithName("First work");
      },
      set() {}
    }
  }
}
</script>

<style scoped>

</style>
